using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace BookingDB.Models.Mapping
{
    public class ShowRoomMap : EntityTypeConfiguration<EntityShowRoom>
    {
        public ShowRoomMap()
        {
            // Primary Key
            this.HasKey(t => t.roomNumber);

            // Properties
            this.Property(t => t.roomNumber)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.row)
                .HasMaxLength(10);

            this.Property(t => t.col)
                .HasMaxLength(10);

            // Table & Column Mappings
            this.ToTable("ShowRoom");
            this.Property(t => t.roomNumber).HasColumnName("roomNumber");
            this.Property(t => t.row).HasColumnName("row");
            this.Property(t => t.col).HasColumnName("col");
        }
    }
}
